package com.hxzy.service.impl;

import com.hxzy.mapper.DeptLogMapper;
import com.hxzy.pojo.DeptLog;
import com.hxzy.service.DeptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author wzm
 * @create 2024-03-12 10:53
 * project_name:JavaWeb2401
 * @Description
 */
@Service
public class DeptLogServiceImpl implements DeptLogService {
    @Autowired
    private DeptLogMapper deptLogMapper;

    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW) //被调用方法添加了事务 特殊情况需要添加传播行为
    public void addLog(DeptLog deptLog) {
        deptLogMapper.insertLog(deptLog);
    }
}
